package KFMmovie;

public class List {
    private Object[] arr;
    private int count;
    private final int capacity;

    public List(){
        this(10);
    }
    public List(int capacity){
        this.capacity = capacity;
        arr = new Object[capacity];
    }

    public void add(Object obj){
        grow();
        arr[count++] = capacity;
    }

    private void grow(){
        if (count == arr.length){
            Object[] newArr = new Object[capacity];
            System.arraycopy(arr,0,newArr,0,arr.length);
            arr = newArr;
        }
    }
}
